﻿using System;
using System.Configuration;

namespace Fuse8.DomainFramework.Configuration.Cache
{
    /// <summary>
    /// 
    /// </summary>
    public class CacheServiceConfigurationHandler : ConfigurationSection
    {
        #region Constructor

        /// <summary>
        /// Constructor
        /// </summary>
        public CacheServiceConfigurationHandler()
        { }

        #endregion

        #region DependencyObjects

        /// <summary>
        /// Cache services collection
        /// </summary>
        [ConfigurationProperty("cacheContainers", IsDefaultCollection = false)]
        public virtual CacheContainersCollection CacheContainers
        {
            get
            {
                return base["cacheContainers"] as CacheContainersCollection;
            }
        }

        #endregion

        #region CachePrefix

        /// <summary>
        /// 
        /// </summary>
        [ConfigurationProperty("keyPrefix", IsRequired = false)]
        public string KeyPrefix
        {
            get
            {
                return this["keyPrefix"].ToString();
            }
            set
            {
                this["keyPrefix"] = value;
            }
        }

        #endregion
    }
}
